﻿namespace Command.CommunityToolkit.Helpers;

/// <summary>
///  ServiceProvide单例类
/// </summary>
public class ServiceProviderHelper
{
    private static ServiceProviderHelper _instance = null!;
    public readonly IServiceCollection ServiceCollection;
    public IServiceProvider? ServiceProvider;
    private ServiceProviderHelper()
    {
        ServiceCollection = new ServiceCollection();
    }

    public static ServiceProviderHelper GetInstance()
    {
        if (Equals(null, _instance))
            _instance = new ServiceProviderHelper();
        return _instance;
    }
}